package Day14;
import java.util.*;

public class Main {

    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);

        int n = in.nextInt();
        int[] ints = new int[n];

        for (int i = 0; i < n; i++) {
            ints[i] = in.nextInt();
        }
        Arrays.sort(ints);

//        for (int i = 0; i < ; i++) {
//
//        }

    }



    public static boolean isLuckyBag (int[] arr ){

        int sum = 0;
        int times = 1;

        for (int i = 0; i < arr.length; i++) {
            sum += arr[i];
            times *= arr[i];
        }

        if (sum > times) {
            return true;
        }
        return false;
    }

    public static void main0 (String[] args) {

            Scanner in = new Scanner(System.in);
            int year = in.nextInt();
            int month = in.nextInt();
            int day = in.nextInt();

            int days = 0;
            for (int i = 1; i < month; i++) {
                days += getMonthDays(year, i);
            }
            days += day;
            System.out.print(days);
        }

    public static boolean isLeapYear (int year) {
        return (year % 4 == 0 && year % 100 != 0) || year % 400 == 0;
    }

    public static int getMonthDays (int year, int mon) {

        if (isLeapYear(year)) {
            int[] leapYear = new int[]{31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 30, 31};
            return leapYear[mon - 1];
        } else {
            int[] notLeapYear = new int[]{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 30, 31};
            return notLeapYear[mon - 1];
        }

    }

}
